package servlet;
import servlet.Connections;
import java.sql.*;
import java.io.*;
import java.io.IOException;
import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

/**
 * Servlet implementation class getDeveloperDetails
 */
public class getDeveloperDetails extends HttpServlet 
{

       
	PrintWriter out;
	
	
	String data ;
    public getDeveloperDetails() {
        super();
        // TODO Auto-generated constructor stub
    }

	/**
	 * @see HttpServlet#doGet(HttpServletRequest request, HttpServletResponse response)
	 */
	protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException 
	{
		Connections conn=new Connections();
		Statement stmt=null;
		ResultSet rs=null;
		String query,developer;
		developer=request.getParameter("dName");
		
		try
		{
			
			out=response.getWriter();
			query="SELECT * from developer where Developer_Name='"+developer+"'";
			
			stmt=conn.getConnection().createStatement();
			rs=stmt.executeQuery(query);
			
			while(rs.next())
			{
				 data=":"+rs.getString(2)+":"+rs.getString(3)+":"+rs.getString(4)+":"+rs.getString(5);
			}
			out.println(data);
		}
		catch(Exception e)
		{
			e.printStackTrace();
		}
		
	}

	/**
	 * @see HttpServlet#doPost(HttpServletRequest request, HttpServletResponse response)
	 */
	protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
		// TODO Auto-generated method stub
	}

}
